package com.wxlgroup.springboot.dao;
import com.wxlgroup.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @auther:wxl
 * @Date:2022/5/20-05-20-19:06
 * @Description:com.wxlgroup.springboot.controller.dao
 * @Version:1.0
 */
@Mapper
public interface UserDao {

    //查询所有用户
    public List<User> queryAll();

    //插入一个新用户
    public Integer insertUser(User user);

    //根据id查询某一个用户
    public User queryUserById(Integer id);

    //删除某个用户
    public Integer deleteUserById(Integer id);

    //修改某个用户
    public Integer updateUserById(User user);

    //查询用户的总条数
    public Integer findUserCounts(@Param("username") String username,@Param("email") String email,@Param("address") String address);

    //分页查询数据
    public List<User> findUsersByPage(@Param("start") Integer start, @Param("end") Integer end
            ,@Param("username") String username,@Param("email") String email,@Param("address") String address);

    //根据用户名和密码查询相应的用户
    public User findUserByUsername(String username);
}
